package com.guigu.controller;


import com.guigu.pojo.Stock;
import com.guigu.pojo.StockDetails;
import com.guigu.service.StockDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 仓库商品明细表 前端控制器
 * </p>
 *
 * @author Mr.Zhang
 * @since 2025-03-12
 */
@CrossOrigin
@RestController
@RequestMapping("/stock-details")
public class StockDetailsController {

    @Autowired
    private StockDetailsService stockDetailsService;

    @PostMapping("/getAllStockDetails")
    @ResponseBody
    public List<StockDetails> getAllStocks() {
        List<StockDetails> stockDetails = stockDetailsService.getStockDetails();

        System.out.println(stockDetails);
        return stockDetails;
    }
}

